<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/订单2.css" />
		<link rel="stylesheet" type="text/css" href="css/header.css" />
		<script type="text/javascript" src="js/html5shiv.min.js"></script>
		<script type="text/javascript" src='js/flexible.debug.js'></script>
	</head>

	<body>
		<header>
			<span class="left" onclick="location.href='dingd.html'"><img src="img/qt.png"/></span>
			<span class="center">订单</span>
			<span class="right"></span>
		</header>
		<div class="bg"><img src="img/bg1.png" /></div>
		<div class="two">
			<div class="hua">
				<label>用&nbsp;&nbsp;户&nbsp;&nbsp;名：<input type="text" placeholder="请输入您的账号"  id="user" autofocus required pattern="^[0-9a-zA-Z]{6,10}$" /></label>
				<label>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" placeholder="请输入您的密码"   id="pwd" required pattern="^\w{8,12}$" /></label>
				<label>确认密码：<input type="password" placeholder="请输入您的密码"   id="pwd2" required pattern="^\w{8,12}$" /></label>
			</div>
			<div class="btn">
				<button type="submit" class="btn" id="btn">同意服务协议并注册</button>
			</div>

		</div>

		<script src="js/jquery-1.11.2.min.js"></script>
		<script src="js/flexible_css.debug.js"></script>
		<script>
			btn.onclick = function() {
				var user = document.getElementById('user').value;
				var pwd = document.getElementById('pwd').value;
				var pwd2 = document.getElementById('pwd2').value;

				if(user && pwd && pwd2) {
					var btn = document.getElementById('btn');
					
					if(pwd == pwd2) {

						if(pwd.length <= 6 || pwd.length >= 12) {
							console.log("密码长度必须大于6小于12");
						} else {
							var reg = (/^[0-9a-zA-Z]{6,10}$/.test(user));
							if(reg) {
								console.log('注册成功！');
								btn.onclick = function() {
						location.href = "dingd.html"
					};

							} else {
								console.log('8-12数字或字母组成');
							};

						}
					} else {
						console.log('两次密码不一致，请重新输入');
					};

				} else {
					console.log('内容不能为空');
				};

			};
		</script>
	</body>

</html>